Skip to content

fix(studio): the CEL condition builder offers membership, not equals, on a list field - #36185

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36167-cel-list-membership
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36167-cel-list-membership

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #36167 — the builder half. The card's Done-when also names validateExpression refusing a list compared with a scalar; that half narrows an accept set and is not built here: the seat picked option A on the card (7068927390), and area a4-C claimed it (7068951634) under its own Part of #36167.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 在 Studio 里给多值字段(多选、标签、多选人员或多选关联)写条件时,操作符从「等于 / 不等于」换成「包含 / 不包含 / 为空 / 不为空」;单值字段不变。
  • 属于 Studio 条件编辑器:多值字段上的「等于」永远不成立、作者毫无提示,这次让编辑器只给出能真正命中的写法。
  • 已保存的「多值字段 等于 某值」条件会改为在表达式框里原样打开,不会被改写;若有问题,作者看到的是表达式框而非行编辑器,可直接撤回本改动。
  • 要你做的:决定是否另做「保存时拒绝多值字段与单值比较」的那一半(见卡片报告里的待决问题)。

What changes

  • ConditionBuilder (the Studio CEL condition builder behind hook, validation-rule, action visibility, page-block and flow entry conditions) now offers a list subject (a multiselect / checkboxes / tags, or a select / lookup / user declared multiple: true) exactly what the shared filter builder offers it: contains, does not contain, is empty, is not empty. == / != / ordering are no longer offered there. Which operators a list takes is read from jsonColumnFilterOperators (through the new listSubjectOperators), not restated; a small table only translates those names onto the builder's own operator values.
  • Contains writes S != null && V in S, does not contain writes S == null || !(V in S). That is the spelling the flow edge's rows shipped; it now lives in one module, inspectors/cel-list-membership.ts (listMembershipCel / readListMembership / listSubjectOperators), and flow-edge-condition-rows.ts writes through it too (its output is byte-for-byte unchanged; its existing pins hold).
  • A row moved onto a list subject leaves equals for contains; moved off a list, membership becomes equals. An operator offered on both sides (is empty / is not empty) stays, re-spelled for the new field.
  • A stored condition whose row uses an operator its subject is not offered (for example record.labels == 'frontend' on a list, or membership on a single-value field) opens in the raw expression editor exactly as stored: never rewritten, nothing emitted.
  • New studio locale key engine.inspector.condition.op.notContains (en, zh).

Tests

  • New pin ConditionBuilder.listSubject-36167.test.tsx (27 tests): each of six list subjects offers the shared builder's list set and nothing else; three single-value controls keep equals / not equals and get no membership; the written CEL equals what the flow edge's rowsToCel writes for the same row and is evaluated by celEngine (member true, non-member false, [] and null null-safe both ways); stored membership round-trips; stored == / != on a list and membership on a single-value field open raw and verbatim; an instrument control shows the replaced == answering a constant.
  • Fixture triage: three existing pins (ConditionBuilder.typedEmptyOps-11894, two cases; ObjectValidationsPanel.typedEmptyOps-11894, one case) seeded a list subject's row as S == 'x' only to reach its operator dropdown. That seed now opens in the raw editor, so it became the membership row; what each case pins (the empty check on a list, and that multiple reaches the builder) is unchanged and still needs the flag to reach the builder.

Acceptance notes

  • Re-measured under celEngine (objectstack tree at this branch): 'a' in S with S = null faults (no such overload for string in a null dyn), with S = [] answers false; S == 'a' is false for ['a','b'] and for null; S.contains('a') faults on a list. Hence the null guard on both membership spellings.
  • A stored S == null / S != null on a list subject also opens raw now (the builder's own spelling for it is is empty / is not empty). Unchanged bytes, by the round-trip rule.
  • The schema-driven condition widget's catalog (ResourceEditPage's object fetch) dropped multiple on this branch's base. fix(ui): the view / page-block filter editor offers a multiple: true field membership only #36182 (merged to main as 865df27) closes it: the fetch now goes through objectCatalogOf, which carries multiple: true, and the condition widget hands that catalog to ConditionBuilder unprojected, so after this PR lands a select / lookup / user declared multiple: true is a list subject at that mount too. multiselect / checkboxes / tags are lists by type alone. The hook, page-block, action, flow-entry and validation-panel mounts carry multiple.
  • node scripts/pm/overlap-check.mjs reports a textual overlap with draft PR feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923 on the studio en / zh catalogues (different keys). Not merged around.

Verification

Read first (risk order):

  1. ui/packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.tsx: initFrom (the new offered-operator check that sends a stored row to the raw editor) and withOfferedOp on a subject change.
  2. ui/packages/app-shell/src/views/metadata-admin/inspectors/cel-list-membership.ts: the shared spelling and reader.
  3. ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-edge-condition-rows.ts: now writes through the shared module.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.listSubject-36167.test.tsx — expect 27 passed.

Local readings at ef21bbcb31 (objectstack tree):

Tests, type-check, ablation
  • ConditionBuilder.listSubject-36167.test.tsx: 27 passed. All inspectors/ConditionBuilder*, flow-edge-condition-rows*, FlowEdgeInspector* suites: 22 files, 262 tests passed (two locked runs; five suites first failed to collect on an unbuilt @objectstack/client, passed once it was built).
  • Mount-site suites (ObjectValidationsPanel*, FlowNodeConfigField*, HookDefaultInspector*, ActionDefaultInspector*, PageBlockInspector.visibleWhen*, FlowNodeInspector.entryCondition*, widgets*ondition*): 33 files, 323 passed, 1 failed before triage (the ObjectValidationsPanel.typedEmptyOps-11894 list seed); after triage that file passes, run with packages/i18n/ (106 files, 1967 passed) and with ui/scripts/ (175 files, 5126 passed).
  • pnpm --filter @object-ui/app-shell type-check and pnpm --filter @object-ui/i18n type-check: exit 0 (lock VERDICT command-exit 0).
  • Ablation (one-off, restored byte-identical to the HEAD blob): deleting the list branch of opChoicesFor through scripts/ablation-replace.mjs (anchor 1 to 0) turns the new pin 19 failed / 8 passed of 27; the 8 are the single-value controls, the instrument control and the raw-open cases.
Gates

node scripts/pm/dispatch-gates.mjs --commands (diff-derived, 38 families) all exit 0 at ef21bbcb31; --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED (a derived zero). pnpm --dir ui check:new-line-citations: 0 new. ESLint on the changed files: 0 errors (warnings pre-existing). CI runs the full farm.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1

Final green head · area a4-D · 2026-11-21T20:58Z
Head: ef21bbcb318a541653a8833180c1b890c9051b09
CI: 45 success, 13 skipped, 0 failed; check-expected-skips.mjs --pr 36185 OK; mergeable clean; check-governed-merges: NOT governed, 497 changed lines; l1-face CLEAN.
Declarations: Clause-②: no · Metadata-protocol: none. Part of #36167: the builder half only. The validator half was ruled A by the seat (7068927390) and is built elsewhere under its own Part of; the seat closes the card by hand after both merge.
Owed: L1 (L1-b). Dev report: comment 7068897946 on #36167. Overlap note: draft PR #35923 touches the same studio i18n files (en.ts, zh.ts), different keys.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T21:01Z

席位核对 — REWORK (PR body only) · head ef21bbc

No code change is asked for. The code, pins, text and gates hold, as listed below. Two sentences in the PR body are no longer true, and one of them is a residual noted with no carrier.

To fix (body edit; the head stays ef21bbc)

  1. Acceptance-notes line "The schema-driven condition widget's catalog (ResourceEditPage's object fetch, projected to { name, label, type }) drops multiple … Noted, not filed." This was true on this branch's base, but it is false on main since fix(ui): the view / page-block filter editor offers a multiple: true field membership only #36182 merged (865df27, 20:55Z).
    • On main, ResourceEditPage's object fetch goes through objectCatalogOf, which carries multiple: true.
    • The condition widget hands that catalog to ConditionBuilder unprojected: widgets.tsx conditionFields = fieldsState.data.
    • So once this PR lands, a select / lookup / user declared multiple: true is a list subject at that mount too.
    • Say that fix(ui): the view / page-block filter editor offers a multiple: true field membership only #36182 closes it, and drop "Noted, not filed". An out-of-scope residual left with no #N would itself be a REWORK item.
  2. Line 4, "…is measured on the card's report as an open question." The question has been answered. Point to the seat's pick A (7068927390) and the validator-half claim by a4-C (7068951634), which carries that half under its own Part of #36167.

A body edit re-runs the PR-body guards. Tell me when they are green, and I will read the body alone.

Checked and holding

  • Shape: l1-face.mjs --pr 36185 is clean at ef21bbc: open, draft, base main.
    • The first line is Part of #36167, which is right for the builder half. No closing keyword binds any card, and the card keeps pm:dispatched until the seat closes it after both halves.
    • The declarations are Clause-②: no · Metadata-protocol: none. The changeset covers @object-ui/i18n, the one published package touched, plus app-shell and console.
  • Is dropping == / != on a list subject UI-only? Yes.
    • Nothing outside the builder's own rendering changes. Compiled CEL for every row it offered before is unchanged, because compileRow only adds the membership branch.
    • A stored condition is never rewritten. initFrom sends a stored S == 'x' on a list subject to the raw editor verbatim, the rule this component already states for text it cannot reproduce, and the reset-to-builder button still refuses to leave raw for such text.
    • No metadata key, value, default or export changes, and no runtime evaluator is touched. Refusing that spelling at validation is the narrowing half, built separately (a4-C).
    • The visible change, that such a stored condition now opens in the expression editor, is in the card's own Done-when. It also matches fix(ui): condition editors offer a multiple: true field only what its evaluator answers #36165's dataset editor, where a stored $eq/$in on a list column opens in Source, and the changeset says so.
  • File surface (area question): no amendment owed. Claim 7067993541 names ConditionBuilder.tsx, its tests and a changeset. The extra files either deliver that change or are pure refactors with no behaviour change. None fixes an adjacent defect, so the four-condition rule does not apply:
    • cel-list-membership.ts is new and holds the one writer and reader. ConditionBuilder needs it, and the claim's Responsibility line names the flow edge spelling it must match.
    • flow-edge-condition-rows.ts swaps its inline membership strings for listMembershipCel and its inline test for listSubjectOperators. That is byte-identical output and the same predicate. Its own suites, flow-edge-condition-rows.test.ts and FlowEdgeInspector.conditionRows-34818, are untouched and green.
    • The studio i18n en/zh files gain one key, engine.inspector.condition.op.notContains, which the new operator's label needs. The studio namespace has only those two locales.
    • ObjectValidationsPanel.typedEmptyOps-11894.test.tsx and ConditionBuilder.typedEmptyOps-11894.test.tsx re-seed 3 fixtures that reached the dropdown through S == 'x' on a list. They use the membership spelling now, and the asserted 「is empty」 CEL is unchanged. These are tests of ConditionBuilder's mounts.
  • Code read:
    • listSubjectOperators reads jsonColumnFilterOperators, so no operator table is copied, and structured JSON is excluded.
    • Membership is null-safe: S != null && V in S and S == null || !(V in S). The reader accepts only what the writer emits, through a compileRow round-trip.
    • Moving a row onto or off a list resets an operator the new subject is not offered (withOfferedOp).
    • The list map is keyed by the same fields / prefix / previous. as declaredSubjectValues, and re-init on catalog arrival goes through the existing declaredKey effect.
  • Pins and controls: ConditionBuilder.listSubject-36167.test.tsx has 27 tests.
    • Six list subjects are offered exactly listSubjectOperators, and three scalar controls keep == / != with no membership.
    • The written CEL equals flow-edge rowsToCel for the same row and is evaluated by celEngine: member, non-member, [] and null. Round-trip and raw-open-verbatim are covered, and an instrument control shows == on a list is a constant.
    • The ablation is from the dev's report, and I did not re-run it. With the list branch of opChoicesFor deleted, 19 ✗ and 8 ✓, the 8 being the controls. The file was restored to its HEAD blob.
  • Changeset, read sentence by sentence: the listed mounts, the four operators, both spellings and their null-safety, the operator reset on a subject move, raw-open verbatim, "a single-value field is offered what it was before" and the new locale key all match the diff.
  • Gates: 45 success, 13 expected skip, 0 unexpected skip, 0 failed and 0 pending. Lint & Repo Gates and TypeScript Type Check are both success, mergeable_state is clean, and the PR is not governed. The overlap with feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923 on the studio i18n files is on different keys.
  • Landing, after the body edit: not governed and not narrowing, so the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T23:16Z

席位核对 — ACCEPT (body) · head ef21bbc

I read the body alone, after REWORK 7069188201. The head is unchanged, so everything checked in that record stands.

  • Item 1: the Acceptance-notes line now says the condition widget's catalog dropped multiple on this branch's base. It says fix(ui): the view / page-block filter editor offers a multiple: true field membership only #36182 (865df27 on main) closes that through objectCatalogOf and the unprojected conditionFields. "Noted, not filed" is gone, so no residual is left without a carrier.
  • Item 2: line 4 now points to the seat's pick A (7068927390) and the validator-half claim by a4-C (7068951634) under its own Part of #36167.
  • Shape: l1-face.mjs --pr 36185 is clean at ef21bbc. Checks are 47 success, 15 expected skip, 0 unexpected skip, 0 failed and 0 pending, and mergeable_state is clean. The PR-body guards re-ran green after the edit.
  • Landing: not governed and not narrowing, so the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1

席位核对

Landing · area a4-D · 2026-11-21T23:17Z · head ef21bbcb318a541653a8833180c1b890c9051b09

Reading Value
L1 REWORK 7069188201 (body only) → ACCEPT 7070761945 (L1-b, this head, body fixed)
Contract none owed: Clause-②: no, no narrowing (L1-b: dropping ==/!= on a list subject is UI-only), no packages/spec/src/**, no governed path; seat agreed
Check-runs 47 success, 15 expected skip (check-expected-skips.mjs OK), 0 failed, 0 pending; mergeable clean; PR-body guards green after the body edit
Governed check-governed-merges --pr 36185: NOT governed, 497 changed lines
Main K = 14 first-parent commits past base (includes #36182); git merge-tree against origin/main clean; the queue build re-tests on main
Overlap overlap-check: merges cleanly with origin/main and #35923

Ready + auto-merge now. Part of #36167: the card stays open and claimed for the validator half (a4-C, 7068951634); the seat closes it by hand after both halves merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 23:17
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 71e02ff Nov 21, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36167-cel-list-membership branch November 21, 2026 23:39
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…ite, and judges a flow condition only where the run binds the typed row (objectstack-ai#36340)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbPgGMxS6cCEEprR4e3dQNe9)_

Fixes objectstack-ai#36167

This is the card's last item: the builder half (objectstack-ai#36185) and the
validator half (objectstack-ai#36207) are merged, and the remaining follow-ups have
their own cards (objectstack-ai#36217 skills text, objectstack-ai#36218 review follow-ups, objectstack-ai#36219
the as-you-type editor).

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up objectstack-ai#36217

## 维护者速读

-
作者把多值字段(多选、多人等)与单个值比较相等时,系统给出的改写建议现在在每个位置都能用:共享规则条件里也能用,且建议本身加了括号,不会被前面的条件拆开;由接口、定时或无触发方式启动的流程里,这种写法不再被误拒。
-
属于「表达式校验与作者护栏」:上一个已合并的拉取请求开始拒绝这种写法,复审发现它给的改写在共享规则里无法生效、部分写法会报错,还会误拒正确的流程条件。
- 若出错,作者看到的只是另一种改写建议,或某个流程条件不再被拦下;本改动可以整体撤回,不影响已存储的数据。
- 无

## What changes

Follow-up to objectstack-ai#36207, which merged before its round-4 review findings
were addressed. This PR covers four of them: r05 S1, r05 S2, r05 S4 /
r06 N1, and r06 S1.

**The prescribed rewrite is spelled for its site and parenthesised
whole** (`listMembershipRewrite` in `packages/formula/src/validate.ts`).
Each spelling below was measured on the site's own evaluator or filter
compiler:

| site | `==` rewrite | `!=` rewrite |
|---|---|---|
| a `record.` / `previous.` read evaluated as CEL (validation rule,
field rule, formula, action `visible` / `disabled` / `pressed`, hook
condition) | `(has(record.f) && record.f != null && "v" in record.f)` |
`(!has(record.f) \|\| record.f == null \|\| !("v" in record.f))` |
| a bare name at a flow condition (the run binds every declared field,
`null` when empty) | `(f != null && "v" in f)` | `(f == null \|\| !("v"
in f))` |
| a sharing rule `condition`, compiled to a query filter (new
`ExprSchemaHint.filterCompiled`, filled by the publish lint) |
`(record.f != null && record.f.contains("v"))` | `(record.f == null \|\|
!record.f.contains("v"))` |

No single spelling works at every site, which is why the rewrite differs
per site:

- `"v" in record.f` does not lower to a filter. `compileCelToFilter`
answers "`in` requires a field on the left (got literal)", so the
sharing rule is dropped as `sharing-rule-unlowerable-condition`.
- `has()` does not lower either ("unsupported operator call").
- On the CEL evaluator, `record.f.contains("v")` faults on a list,
because there is no `list.contains` overload.
- `record.f != null && "v" in record.f` faults on a row that lacks the
key ("No such key"), which a sparse action row does. It also faults on a
null `previous`, as on a create.

The filter spelling lowers to `$and[{f:{$null:false}},
{f:{$contains:"v"}}]` and `$or[{f:{$null:true}},
{$not:{f:{$contains:"v"}}}]`. `$contains` on a JSON-stored (multi-value)
column is membership in `matchesFilterCondition` and in driver-sql
(`sql-driver-17590-json-column-membership.test.ts`). A number or boolean
operand is passed as its text (`contains("3")`), since `$contains`
compares text. The sharing-site message also says why `==` does not work
there: the query filter refuses `$eq` against a list column.

**A flattened (flow) site is judged only where the run binds a row of
the typed object** (r06 S1). `checkListEquality` now returns early at a
`'flattened'` site unless `faultOutcome` is `'run-fails'`. That outcome
is declared only on a record-triggered flow, or on a time-relative sweep
of the typed object: the lint's `faultOutcomeOf` ledger,
`validate-expressions.ts` around line 1632. On any other flow (API,
schedule, no trigger), the ledger's own row says the run "holds what its
entrance handed it". `seedRunVariables` flattens whatever record that
is. So an API flow whose request body carries a string `labels` runs
`labels == 'frontend'` correctly, and objectstack-ai#36207 refused it. The MCP tool
already passes this outcome for `flow_condition` (its default
`triggerKind` is `record_change`). `registerFlow`'s advisory pass now
passes it on the same flows (`runBindsTypedRow`, which this PR moves
above the hint). Side effect: on those flows, the pass's logged
type-mismatch lines take the `run-fails` wording that `os validate`
already prints. It still only logs and never throws.

**Docblocks (r05 S4 / r06 N1).**
- `ExprSchemaHint.multiValueFields` now names the forms actually judged:
  - `record.f` / `previous.f` and the bracket spelling;
  - the optional spellings, which are refused as `invalid-cel` first;
- the bare name, only at a flattened site with `run-fails`, excluding
`flowVariables` and `bareNamesUnproven`;
  - comprehension-bound names, which are never the field.
- `ExpressionRefusalParams['list-equality']` now documents `reference`
(the bracket spelling renders `record.f`; a bare name is the bare name)
and the per-site `rewrite`.

**Semantic entry** `cel-list-equality-refused` now has the per-site
replacement text and the narrowed surface. The surface adds the sharing
rule condition and limits flows to the proven-row ones.

## Tests

- `packages/formula/src/validate-list-equality-36167.test.ts`
- New describe, "the prescribed rewrite tests membership where it is
read". For each site class it takes the rewrite out of the refusal
itself, pins its text, and runs it:
- **CEL member read:** evaluated on rows `[a,b]` / `[b]` / `[]` / `null`
/ absent, and with `previous = null`. Each is also checked inside
`record.name == 'x' && …`, `record.name == 'y' && …` and `false || …`,
which pins the parenthesisation.
    - **Bare name:** evaluated with the row bound as top-level names.
- **Filter:** lowered with `compileCelToFilter` and matched with
`matchesFilterCondition` (with the column declared `tags`), including
inside `&&`.
    - Each rewrite validates clean at its own site.
    - The CEL `in` form is shown not to lower.
- New describe, "a flattened site with no proven row binding gets no
verdict": bare and `record.` reads, `fail-closed` / `fail-open`, plus a
proven-site control.
- `packages/formula/src/expression-refusal-codes.test.ts`: the two
`list-equality` PINS carry the new rewrites. Two new pins cover the bare
name at a proven flattened site and the `filterCompiled` site, with
params and the whole message.
- `packages/lint/src/validate-expressions.list-equality-36167.test.ts`:
  - action `visible` rewrites pinned, and each validates clean;
- a flow condition's bare `!=` rewrite pinned in the parenthesised form
and accepted inside `stage == 'qa' && …`;
- CONTROLS: an API, a trigger-less autolaunched and a scheduled flow get
no list-equality, bare or `record.`;
- new describe, the sharing rule `condition`: refused with the
`contains` rewrite, and that rewrite draws no finding from the
expression lint or from `validateSharingRuleEnforceability` (it lowers);
- CONTROL: the CEL `in` forms draw `sharing-rule-unlowerable-condition`
there.
-
`packages/services/service-automation/src/list-equality-advisory-36167.test.ts`:
  - `makeFlow` now states its trigger (`record-after-update`);
  - parenthesised bare rewrite pinned and not reported itself;
  - CONTROLS: API, scheduled and trigger-less flows report nothing;
- premise: the bare rewrites answer per row on `evaluateCondition`,
including `false && (…)`.
- Two fixtures fixed at `254d40cb` (they had never run; each stopped
before the behaviour it pins):
- the sharing-rule describe in the lint pin built its rule with a
recipient type the spec does not have (`role`) and no rule `type`, so
all three cases failed at the spec-validity guard. It now uses `type:
'criteria'` and a `team` recipient, as the other spec-valid sharing
fixtures do;
- the API-flow CONTROL in the service-automation pin carried no hook
secret, so `registerFlow` refused the flow before the advisory pass ran.
It now names a `secretRef` (ADR-0041).
-
`packages/mcp/src/mcp-validate-expression.list-equality-36167.test.ts`:
the `flow_condition` rewrite is pinned and validates clean. CONTROL:
`triggerKind` `api` / `schedule` / `none` get no list-equality.

## Acceptance notes

- **Clause ② for this diff: `yes (widening)`.** Two things widen:
  - it adds the optional public key `ExprSchemaHint.filterCompiled`;
- flow conditions on API / scheduled / trigger-less flows are accepted
again, after objectstack-ai#36207 refused them.

Nothing in this diff refuses more. The changed rewrite text and the
narrower flattened scope are not narrowings. `Metadata-protocol: added`
because an accepted value is restored, so every package moved is
`minor`.
- The driver-sql leg of the filter rewrite is cited, not run here:
`$contains` membership on a JSON column is pinned in
`sql-driver-17590-json-column-membership.test.ts`, and `$not` is
NULL-safe (objectstack-ai#5146). This PR measures the lowering and
`matchesFilterCondition`.
- Decision node `config.condition` in the lint: only the start node's
gate and edge / branch conditions carry the flow's outcome. An inert
node condition already has its own `flow-inert-node-condition` finding,
and gets no list-equality verdict.
- L2 S1 carried by objectstack-ai#36218 (scope !== 'record'); nits N1–N4 accepted.

## Verification

Final head `254d40cb` (handover head `5a29954a` + `origin/main` merged
at `2b570445` + the two fixture fixes). Every reading below is at that
head.

<details><summary>Package suites and pins</summary>

- Build closure `--filter '@objectstack/lint^...' --filter
'@objectstack/mcp^...' --filter '@objectstack/service-automation^...'
--filter '@objectstack/scenarios^...' build`: lock VERDICT command-exit
0. Later a full `pnpm build --concurrency=2`: 120/120 tasks, VERDICT
command-exit 0.
- Pins: formula `validate-list-equality-36167` +
`expression-refusal-codes` 250/250 (the 8 bare-name failures of the
handover run are gone); lint `validate-expressions.list-equality-36167`
27/27 (3 failed before the fixture fix); mcp
`mcp-validate-expression.list-equality-36167` 15/15; service-automation
`list-equality-advisory-36167` 22/22 (1 failed before the fixture fix).
- Full suites, one locked run, VERDICT command-exit 0: formula build +
test 70 files / 2107 tests + typecheck exit 0; lint 225 files / 9434
tests + typecheck exit 0; mcp 83 files / 1467 tests + typecheck exit 0;
service-automation 290 files / 4220 tests + typecheck exit 0; spec
`src/migrations` 5 files / 198 tests.

</details>

<details><summary>Ablations (seven, each through ablation-replace WRAP
mode under the lock)</summary>

Each mutation was proven on disk (anchor 1 to 0, blob changed) and
restored (blob equal to the HEAD blob, empty `git diff HEAD`). Every
mutated module is read from source by its suite, so there is no dist
leg.

| ablation | file | pin result |
|---|---|---|
| delete the flattened proven-row early return | formula `validate.ts` |
5 failed / 245 passed (250) |
| never take the `filterCompiled` spelling | formula `validate.ts` | 13
failed / 237 |
| drop the outer parentheses of the `!=` member-read rewrite | formula
`validate.ts` | 6 failed / 244 |
| drop `has()` from the `==` member-read rewrite | formula `validate.ts`
| 4 failed / 246 |
| lint passes no `filterCompiled` at the sharing rule | lint
`validate-expressions.ts` | 2 failed / 25 (27) |
| service-automation always declares `run-fails` |
`flow-registration-checks.ts` | 3 failed / 19 (22): the API, scheduled
and trigger-less CONTROLS |
| service-automation never declares `run-fails` |
`flow-registration-checks.ts` | 5 failed / 17 (22) |

</details>

<details><summary>Derived gates</summary>

- `dispatch-gates --commands` at `254d40cb`: 96 families.
`dispatch-gates --ran` with recorded exit codes: 96 derived, 96 run, 0
NOT-MEASURED (a derived zero), every family exit 0.
- Three needed a prerequisite first and were re-run:
`check-plugin-teardown-shape --self-test` (exit 3 on the shallow clone
until its pinned fixture commit was fetched, then exit 0); the cli
`migrate-meta-engine-guidance` vitest (exit 1, MODULE_NOT_FOUND on an
unbuilt `@objectstack/mcp` dist, then 3/3 after the full build);
`check:dual-build-cjs-loads` (exit 3 PREREQUISITE NOT MET, then exit 0
after the full build: 124 require entry points across 72 packages load).
- `check:type-check-debt` exit 0. `check:nul-bytes` OK. `overlap-check`
VERDICT clean exit 0 against `origin/main` `2b570445` and objectstack-ai#36333 (shares
`validate.ts`, merges cleanly).
- CI at `254d40cb`: all 69 check-runs completed, every one success or
skipped (Check Changeset, PR-body guards, Governed Surface Queue Guard,
every Lint and Type Check lane, Test Core 10/10 shards, Test UI 16/16,
Build Core, Dogfood Regression Gate).
- `test:repo` was not run locally (the diff touches no repo-project
test); CI's Test Core ran it.

</details>

Dogfood battery: n/a (no `!` in the title, and `Clause-②: yes
(widening)` has no `(narrowing)` arm).

Two-minute check: `pnpm --filter @objectstack/formula exec vitest run
src/validate-list-equality-36167.test.ts`. Expected: every test passes,
including the "prescribed rewrite" and "no proven row" describes.

Read first, by risk:
1. `packages/formula/src/validate.ts`: `listMembershipRewrite` and the
early return in `checkListEquality`.
2.
`packages/services/service-automation/src/flow-registration-checks.ts`:
`faultOutcome` on the advisory hint.
3. `packages/lint/src/validate-expressions.ts`: the sharing-rule
`check(…, true)`.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jVXKcrF3rr7ShYFZ9E

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jVXKcrF3rr7ShYFZ9E -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant